## Warning: We recommend using the dplyr::*_join() family of functions instead.
## Warning: `group_by_()` was deprecated in dplyr 0.7.0.
## Please use `group_by()` instead.
## See vignette('programming') for more help
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated.
## Warning: sf layer has inconsistent datum (+proj=longlat +datum=NAD83 +no_defs).
## Need '+proj=longlat +datum=WGS84'
## Warning: We recommend using the dplyr::*_join() family of functions instead.
## Warning: sf layer has inconsistent datum (+proj=longlat +datum=NAD83 +no_defs).
## Need '+proj=longlat +datum=WGS84'
## `summarise()` has grouped output by 'county'. You can override using the
## `.groups` argument.
acs_hud_de_geojoined_prop <- acs_hud_de_geojoined %>%
mutate(diff_30_50 = eligible_renters - eligible_renters_50pct) %>%
mutate(eligible_renters_30pct_prop = eligible_renters / renter_householdersE,
eligible_renters_50pct_prop = eligible_renters_50pct / renter_householdersE,
diff_prop_30_50 = eligible_renters_30pct_prop - eligible_renters_50pct_prop)
scatter_30_50 <- acs_hud_de_geojoined_prop %>%
ggplot(aes(x = eligible_renters, y = eligible_renters_50pct,
label = census_tract_label, color = diff_30_50)) +
geom_smooth(method = "lm") +
geom_point() +
xlab("Households paying 30%+ on rent") +
ylab("Households paying 50%+ on rent")
ggplotly(scatter_30_50)
## `geom_smooth()` using formula 'y ~ x'
barplot_30_50_diff <- acs_hud_de_geojoined_prop %>%
ggplot(aes(x = reorder(tract, diff_30_50), y = diff_30_50)) +
geom_bar(stat = "identity") +
xlab("Census Tracts") +
ylab("Difference between 30% vs 50%")
barplot_30_50_diff %>% ggplotly()
scatter_30_50_prop <- acs_hud_de_geojoined_prop %>%
ggplot(aes(x = eligible_renters_30pct_prop, y = eligible_renters_50pct_prop,
label = census_tract_label, color = diff_prop_30_50)) +
geom_smooth(method = "lm") +
geom_point() +
xlab("Proportions of households paying 30%+ on rent") +
ylab("Proportions of households paying 50%+ on rent")
ggplotly(scatter_30_50_prop)
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 4 rows containing non-finite values (stat_smooth).
barplot_30_50_prop_diff <- acs_hud_de_geojoined_prop %>%
ggplot(aes(x = reorder(tract, diff_prop_30_50), y = diff_prop_30_50)) +
geom_bar(stat = "identity") +
xlab("Census Tracts") +
ylab("Difference between 30% vs 50% (proportions)")
barplot_30_50_prop_diff %>% ggplotly()
## Warning: Removed 4 rows containing missing values (position_stack).
Higher numbers mean that the census tract has higher proportions of renters paying 30% or more income on rent than those paying 50% or more income on rent.
scatter_30_50_voucher <- acs_hud_de_geojoined_prop %>%
ggplot(aes(x = prop_serviced, y = diff_prop_30_50, label = tract)) +
geom_smooth(method = "lm") +
geom_point() +
xlab("Proportion of eligible renters receiving a voucher") +
ylab("Difference between 30% vs 50% (proportions)")
scatter_30_50_voucher %>% ggplotly()
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 55 rows containing non-finite values (stat_smooth).